package com.hp.demo.vteam.bean;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.users.User;
import com.hp.demo.vteam.base.annotation.Exclude;
import com.hp.demo.vteam.base.annotation.PropertyExpr;
import com.hp.demo.vteam.base.annotation.PropertyRender;
import com.hp.demo.vteam.base.annotation.Render;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class InforKind {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long id;

    @Persistent
    private String name;
        
    @Persistent
    private String desc;

    @Persistent
    private User addedBy;
    
	@Persistent
	@PropertyRender(parser=Render.dateFormat)
    private Date addedTime;
	
	@Persistent(mappedBy="inforKind")
	@Exclude
	private List<Information> informations;
	
	public InforKind(Long id)
	{
		this.id = id;
	}
	
    public InforKind(String name,String desc, User addedBy, Date addedTime) {
    	this.addedBy = addedBy;
        this.name = name;
        this.desc = desc;
        this.addedTime = addedTime;
    }

    public Long getId() {
        return id;
    }

	public User getAddedBy() {
		return addedBy;
	}

	public void setAddedBy(User addedBy) {
		this.addedBy = addedBy;
	}

	public String getName() {
		return name;
	}

    public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	public Date getAddedTime() {
		return addedTime;
	}

	public void setAddedTime(Date addedTime) {
		this.addedTime = addedTime;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public List<Information> getInformations() {
		return this.informations;
	}

	public void setInformations(List<Information> informations) {
		this.informations = informations;
	}
}
